﻿<%@ Page Language="C#" MasterPageFile="~/Common/Master/FrameMain.master" AutoEventWireup="true"
    Inherits="Project_Task_List" Title="无标题页" CodeBehind="List.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        #list .style1
        {
            width: 10px;
            text-align: center;
        }
        th, td
        {
            white-space: nowrap;
        }
        .progress
        {
            border: solid 1px green;
            width: 80px;
            line-height: 8px;
            height: 8px;
            float: left;
        }
        .progress div
        {
            background-color: Green;
            line-height: 8px;
            height: 8px;
        }
    </style>

    <script type="text/javascript">
        function MoveCheck()
        {
            var hidSelectIDs = document.getElementById("<%=hidSelectIDs.ClientID %>");
            if (hidSelectIDs.value == "")
            {
                alert("请选择目标任务");
                return false;
            }
        }

        function InitSelect()
        {
            var hidSelectIDs = document.getElementById("<%=hidSelectIDs.ClientID %>");
            if (hidSelectIDs.value != "")
            {
                var trIDs = hidSelectIDs.value.split(",");
                for (var i = 0; i < trIDs.length; i++)
                {

                    if (trIDs[i] != "")
                    {
                        var chk = document.getElementById(trIDs[i]).cells[1].getElementsByTagName("input")[0];
                        chk.click();
                    }
                }
            }
        }

        function setProgress(id, percent)
        {
            var divPro = document.getElementById("pro_" + id);
            divPro.style.width = percent + "%";

            var spanPer = document.getElementById("per_" + id);
            spanPer.innerText = percent;
            //window.setTimeout
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:HiddenField ID="hidHideTrIDs" runat="server" />
    <input id="hiddenClientID" type="hidden" value="<%=hidHideTrIDs.ClientID %>" />
    <div id="toolbar">
        <ul>
            <li><a id="lnkDelete" runat="server" href="javascript:;"><span><b style="background-image: url(../../common/images/icons/DELETE.gif);">
                &nbsp;</b>删除</span> </a></li>
            <li><a id="lnkMoveLeft" runat="server" href="javascript:;"><span><b style="background-image: url(../../common/Images/Common/move_left.gif);">
                &nbsp;</b>升级</span></a></li>
            <li><a id="lnkMoveRight" runat="server" href="javascript:;"><span><b style="background-image: url(../../common/Images/Common/move_right.gif);">
                &nbsp;</b>降级</span></a></li>
            <li><a id="lnkMoveUp" runat="server" href="javascript:;"><span><b style="background-image: url(../../common/Images/Common/move_up.gif);">
                &nbsp;</b>上移</span></a></li>
            <li><a id="lnkMoveDown" runat="server" href="javascript:;"><span><b style="background-image: url(../../common/Images/Common/move_down.gif);">
                &nbsp;</b>下移</span></a></li>
            <li><a id="lnkReturn" runat="server"><span><b style="background-image: url(../../common/Images/Common/return.gif);">
                &nbsp;</b>返回</span></a> </li>
            <li>
                <asp:Button ID="btnDelete" runat="server" Text="删除" CausesValidation="False" OnClick="btnDelete_Click"
                    CssClass="hide" />
                <asp:Button ID="btnRefresh" runat="server" OnClick="btnRefresh_Click" Text="Button"
                    CssClass="refresh" /><asp:Button ID="btnMoveLeft" runat="server" CssClass="hide"
                        Text="Button" OnClick="btnMoveLeft_Click" />
                <asp:Button ID="btnMoveRight" runat="server" Text="Button" CssClass="hide" OnClick="btnMoveRight_Click" />
                <asp:Button ID="btnMoveUp" CssClass="hide" runat="server" Text="Button" OnClick="btnMoveUp_Click" />
                <asp:Button ID="btnMoveDown" runat="server" Text="Button" CssClass="hide" OnClick="btnMoveDown_Click" />
            </li>
        </ul>
    </div>
    <table id="head">
        <tr>
            <td class="left" style="text-align: left">
                <asp:Label ID="Label1" runat="server" Text="项目："></asp:Label> <asp:DropDownList ID="drpPrj" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="drpPrj_SelectedIndexChanged">
                </asp:DropDownList>
                <span style="color: Red; font-weight: bold">有情提示：</span><img src="../../Common/Images/Common/gw_red.gif"
                    align="absmiddle" alt="" style="margin-right: 10px;" />延时<img src="../../Common/Images/Common/gw_green.gif"
                        align="absmiddle" style="margin-left: 10px; margin-right: 10px;" alt="" />正常<span
                            style="margin-left: 10px; color: Red;">红色</span>为里程碑
            </td>
        </tr>
    </table>
    <div id="list">
        <asp:HiddenField ID="hidSelectIDs" runat="server" Value="" />
        <table border="0" cellpadding="0" cellspacing="0" id="lvList">
            <tr id="lvHeader" runat="server">
                <th class="sp">
                    &nbsp;
                </th>
                <th class="chk">
                    <asp:CheckBox ID="chkSelectAll" runat="server" />
                </th>
                <th class="style1">
                    &nbsp;
                </th>
                <th>
                    任务名称
                </th>
                <th style="width: 60px; text-align: center;" nowrap="nowrap">
                    子任务
                </th>
                 <th style="text-align: center;">
                    操作
                </th>
                 <th>
                    执行人
                </th>                
                <th style="width: 60px;">
                    工期
                </th>
                <th style="width: 100px; text-align: center;" nowrap="nowrap">
                    计划开始日期
                </th>
                <th style="width: 100px; text-align: center;" nowrap="nowrap">
                    计划结束日期
                </th>
               
                <th class="last" >
                    完成进度
                </th>
               
            </tr>
            <asp:ListView ID="lv" runat="server" OnItemDataBound="lv_ItemDataBound">
                <LayoutTemplate>
                    <tr id="itemPlaceholder" runat="server">
                    </tr>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr runat="server">
                        <td class="sp">
                            &nbsp;
                        </td>
                        <td class="chk">
                            <asp:CheckBox ID="chkSelect" runat="server" />
                        </td>
                        <td class="style1" style="width: 20px;">
                            <img alt="" src='../../Common/Images/Common/<%#Eval("flag") %>' />
                        </td>
                        <td>
                            <asp:Literal ID="litSpace" runat="server" Text='<%# Eval("Space") %>'></asp:Literal>
                            <asp:HyperLink ID="lnkName" runat="server" NavigateUrl="javascript:go();" Text='<%# Eval("Name") %>'></asp:HyperLink>
                            <asp:HiddenField ID="hidUpperID" runat="server" Value='<%# Eval("UpperID") %>' />
                        </td>
                        <td style="text-align: center;">
                            <asp:HyperLink ID="lnkAdd" runat="server" NavigateUrl="javascript:;">添加</asp:HyperLink>|<asp:HyperLink
                                ID="lnkEdit" runat="server" NavigateUrl="javascript:;">变更</asp:HyperLink>
                        </td>
                        <td style="text-align: center;">
                            <asp:HyperLink ID="lnkSchedule" runat="server">进度</asp:HyperLink>|<asp:HyperLink
                                ID="lnkOversee" runat="server">督办</asp:HyperLink>|<asp:HyperLink ID="lnkAttach" runat="server">附件</asp:HyperLink>
                        </td>
                        <td>
                            <%#Eval("UserNames") %>&nbsp;
                        </td>
                        <td>
                            <%#Eval("TimeLimit") %>&nbsp;工作日<asp:Literal ID="Literal1" runat="server" Text="?"
                                Visible='<%#Eval("IsPrediction") %>'></asp:Literal>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("StartTime","{0:yyyy-MM-dd}") %>&nbsp;
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("EndTime", "{0:yyyy-MM-dd}")%>&nbsp;
                        </td>
                        
                        <td style="padding-left: 0px;">
                            <table border="0" cellpadding="0" cellspacing="0" width="110px;">
                                <tr>
                                    <td style="border-bottom-width: 0px;">
                                        <div class="progress">
                                            <div id='pro_<%#Eval("ID") %>' style='width: <%#Eval("Percent") %>%'>
                                            </div>
                                        </div>
                                    </td>
                                    <td style="border-bottom-width: 0px; width: 30px;">
                                        <span id='per_<%#Eval("ID") %>'>
                                            <%#Eval("Percent") %></span>%
                                    </td>
                                </tr>
                            </table>
                        </td>
                        
                    </tr>
                </ItemTemplate>
            </asp:ListView>
        </table>
    </div>
</asp:Content>
